package com.example.java.designpattern;

/**
 * @author zengty
 * @apiNote 模板方法
 * @date 2024/8/29
 * @project study
 */
public abstract class TemplateMethodDivisor implements Divisor {

    @Override
    public final void divide(String s) {
        if (isOk(s)){
            divide1(s);
        }
        divide2(s);
    }

    protected abstract void divide2(String s);

    protected abstract void divide1(String s);

    protected abstract boolean isOk(String s);
}
